<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			let arr = [[1,2,3,4],[4,5,6,7],[0,7,8,9]]
			let a=arr[0].map((o,p) => arr.map(s => s[p]))
			console.log(a);
			 
			 var newArray = arr[0].map(function (col, i) {
			        return arr.map(function (row) {
			            return row[i];
			        })
			   });
			 console.log(newArray);
		</script>
	</body>
</html>
